How to refactor multiple if statements to decrease cognitive complexity

welcome to shbcf.ru